/*
 * cli.c
 *
 *  Created on: Apr 4, 2012
 *      Author: root
 */

// CHATTING PROGRAM SERVER v1.1

#include	"unp.h"

#define IDSIZE 20

int main(int argc, char **argv) {
	int sockfd;
	struct sockaddr_in servaddr;

	/////////////////////////
	int s;

	char msg[MAXLINE];
	memset(msg, 0x00, MAXLINE);

	/////////////////////

	if (argc != 2)
		err_quit("usage: tcpcli <IPaddress>");

	sockfd = Socket(AF_INET, SOCK_STREAM, 0);

	if (sockfd < 0) {
		perror("socket call failed");
		exit(1);
	}
	bzero(&servaddr, sizeof(servaddr));
	servaddr.sin_family = AF_INET;
	servaddr.sin_port = htons(SERV_PORT);
	Inet_pton(AF_INET, argv[1], &servaddr.sin_addr);

	Connect(sockfd, (SA *) &servaddr, sizeof(servaddr));

	str_cli(stdin, sockfd);
}




